<p>Standard Swift strings use double quotes, but you can’t include line breaks in there.</p>
<p>If you want multi-line strings you need slightly different syntax: start and end with three double quote marks, like this:</p>
<pre class="code">
<p></p>
<p><span class="keyword">var</span> str1 <span class="operator">=</span> <span class="string">"""</p>
<p>This goes</p>
<p>over multiple</p>
<p>lines</p>
<p>"""</span></p>
<p></p>
</pre>

<p style="height: 0px; margin-bottom: 0px;"></p>
<p>Swift is very particular about how you write those quote marks: the opening and closing triple must be on their own line, but opening and closing line breaks won’t be included in your final string.</p>
<p>If you only want multi-line strings to format your code neatly, and you don’t want those line breaks to actually be in your string, end each line with a <code>\</code>, like this:</p>
<pre class="code">
<p></p>
<p><span class="keyword">var</span> str2 <span class="operator">=</span> <span class="string">"""</p>
<p>This goes \</p>
<p>over multiple \</p>
<p>lines</p>
<p>"""</span></p>
<p></p>
</pre>

<p style="height: 0px; margin-bottom: 0px;"></p>